<template>
    <view>
        <view>
            <VoteList :list="voteList" />
        </view>
    </view>
</template>
<script>
import {getVoteListByUser} from '@/api'
import {mapState} from 'vuex'
import VoteList from './components/VoteList.vue'
import ls from '@/util/ls'
export default {
    components: {
        VoteList
    },
    data() {
        return {
            voteList:[]
        }
    },
    computed: {
        ...mapState("app",["userInfo"]),
        ...mapState("community",["communityId"])
    },
    onLoad() {
        this.init()
    },
    methods: {
        async init() {
            let userInfo=ls.get("user")
            let res = await getVoteListByUser({
                liveUserId:userInfo.wxUser.wxUserId,
               communityId:this.communityId
                 // communityId:2
            })
          
            this.voteList = res.rows
        }
    }
}
</script>
<style lang="scss" >
page{
    background: $uni-bg-color-grey;
}
</style>